<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            padding-bottom: 800px;
            background-color: #333;
        }
        .box{
            width: 600px;
            height: 80px;
            position: relative;
        }
        .tabbar{
            width: 100%;
            height: 100%;
            background-color: white;
            display: flex;
            flex-flow: row nowrap;
        }
        .tabbar .item{
            width: 25%;
            text-align: center;
            line-height: 80px;
            position: relative;
            cursor: pointer;
        }
        .tabbar .item span{
            display: inline-block;
            position: absolute;
            left: 50%;
            top: 0px;
            transform: translate(-50%,0px);
            z-index: 4;
            background-color: white;
            height: 60px;
            width: 60px;
            line-height: 80px;
            border-radius: 50%;
            transition: all 150ms ease;
        }
        .tabbar .item span.active{
            top: -10px;
            line-height: 60px;
        }
        .active-box{
            position: absolute;
            left: 0%;
            top: 0px;
            width: 25%;
            height: 100%;
            background-color: #333;
            overflow: hidden;
            transition: all 200ms ease;
        }
        .active-box::before,.active-box::after{
            position: absolute;
            top: 0px;
            content: "";
            display: inline-block;
            height: 100%;
            width: 40px;
            background-color:white;
        }
        .active-box::before{
            border-radius: 0px 100% 0px 0px;
            left: 0px;
        }
        .active-box::after{
            border-radius: 100% 0px 0px 0px;
            right: 0px;
        }

        .active-box .pot{
            width: 89px;
            height: 85px;
            background-color:transparent;
            border-radius: 50%;
            position: absolute;
            z-index: 2;
            left: 50%;
            top: -22px;
            transform: translate(-50%,0);
            box-shadow: 0 32px 0px white;
        }
        
    </style>
</head>
<body>

    <div id="app">
        <br><br><br>
        <div class="box">
            <div class="tabbar">
                <div class="item" @click=" active=0 ">
                    <span :class="{ active:active==0 }">A</span>
                </div>
                <div class="item" @click=" active=1 ">
                    <span :class="{ active:active==1 }">B</span>
                </div>
                <div class="item" @click=" active=2 ">
                    <span :class="{ active:active==2 }">C</span>
                </div>
                <div class="item" @click=" active=3 ">
                    <span :class="{ active:active==3 }">D</span>
                </div>
            </div>
            <div class="active-box" :style=" { left:25*active+'%' } ">
                <div class="pot"></div>
            </div>
        </div>


    </div>
    <script type="module"> 
        import { createApp } from "../assets/vue3/vue.esm-browser.js";
        createApp({
            data(){
                return {
                    active:0
                }
            }
        }).mount("#app")
    </script>
</body>
</html>